import Router from "vue-router";
import Vue from "vue";
Vue.use(Router);
const routes = [
  {
    path: "/",
    redirect: "/menu",
  },
  {
    path: "/login",
    name: "Home",
    component: () => import("../page/Login"),
  },
  {
    path: "/menu",
    name: "Menu",
    menu: "菜单栏",
    redirect: "/menu/userManage",
    component: async () => import("../layout"),
    children: [
      {
        path: "userManage",
        name: "UserManage",
        menu: "用户管理",
        component: async () => import("../page/userManage"),
      },
      {
        path: "workManage",
        name: "WorkManage",
        menu: "作品管理",
        component: async () => import("../page/workManage"),
      },
      {
        path: "apiManage",
        name: "ApiManage",
        menu: "Api管理",
        component: async () => import("../page/apiManage"),
      },
      {
        path: "discussesManage",
        name: "DiscussesManage",
        menu: "留言点赞管理",
        component: async () => import("../page/discussesManage"),
      },
    ],
  },
];
export default new Router({
  routes,
});
